//
//  AppModel.m
//  ScholarsBridge
//
//  Created by xp on 17/2/15.
//  Copyright © 2017年 mingthink. All rights reserved.
//

#import "HostUtil.h"

//#ifdef DEBUG
//#define kServerModel 0
//#else
//#define kServerModel 2
//#endif

#define kServerModel  0  //0,1可以循环切换模式2不能,正式发布时改成2

@implementation HostUtil

+ (HostUtil *)sharedInstance
{
    static HostUtil *instance = nil;
    static dispatch_once_t predicate;
    dispatch_once(&predicate, ^{
        instance = [[self alloc] init];
        instance.mode = kServerModel;
    });
    return instance;
}

-(NSString *)getApiHost
{
    NSString *url;
    if (_mode == 0) {//开发模式
       url = @"http://devapi.91luqu.cn";//http://172.16.1.115:48055，http://devapi.91luqu.cn
    }else if (_mode == 1){//测试模式
        url = @"http://testapi.91luqu.cn";
    }else{//发布模式
       url = @"https://api.91luqu.cn";
    }
    return url;
}

-(NSString *)getWebHost
{
    NSString *url;
    if (_mode == 0) {//开发模式
        url = @"https://www.cex.com";//http://172.16.1.115:48056，http://devhybrid.91luqu.cn
    }else if (_mode == 1){//测试模式
        url = @"https://www.cex.com";
    }else{//发布模式
        url = @"https://www.cex.com";
    }
    return url;
}

@end
